package com.itheima.chapter09.io.charstream;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

//字符流用户注册案例
public class Case1 {
    public static void main(String[] args) throws IOException {
        Scanner sc= new Scanner(System.in);
        System.out.println("请输入用户名：");
        String name = sc.next();
        System.out.println("请输入您的密码：");
        String psd = sc.next();
        FileWriter fw =new FileWriter(new File("c.txt"));
        fw.write(name);
        fw.write("\r\n");
        fw.write(psd);
        fw.flush();
        fw.close();

    }
}
